#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTableWidgetItem>

#include <QMap>
#include <QString>
//#include <QDateTime>

//Excel 表格返回的数据
//typedef struct{
//    int row;        //行数
//    int column;     //列数
//    float * data;   //数据指针
//    int len;        //数据长度
//} EXCEL_DATA_T;



namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();



//    EXCEL_DATA_T excel_data;

private slots:
    void on_pushButton_clicked();

    void on_tableWidget_itemSelectionChanged();

    void on_tableWidget_itemChanged(QTableWidgetItem *item);

    void on_tableWidget_itemClicked(QTableWidgetItem *item);

//    void on_lineEdit_Power_generation_1_editingFinished();

//    void on_lineEdit_Power_generation_2_editingFinished();

//    void on_lineEdit_Power_generation_all_editingFinished();

//    void on_lineEdit_steam_1_editingFinished();

//    void on_lineEdit_steam_2_editingFinished();

//    void on_lineEdit_steam_3_editingFinished();

//    void on_lineEdit_steam_all_editingFinished();

//    void on_lineEdit_Running_time_editingFinished();

//    void on_lineEdit_Electric_quantity_out_power_grid_editingFinished();

//    void on_lineEdit_power_in_factory_editingFinished();

    void on_pushButton_savedata_clicked();


    void change_data_from_editline();

private:
    Ui::MainWindow *ui;

    //数据对应的表格中位置
    QMap<QString,QString> data_map;

    //数据列表
    QStringList data_list;

    //标题列表
    QStringList excel_title;

    //当前时间
    QString current_date;

public:
    static void get_excel_data(QString file_name);

private:
    void init();


    void display_data_from_list_to_editline();
    void updata_from_editline_to_list();

    //界面上的编辑框改变时，执行的动作
//    void change_data_from_editline();

    //设置表格样式
    void Interface_config();

};

#endif // MAINWINDOW_H
